<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <script type="text/javascript" src="${ctx}/appjs/order/orderInfo/saasCountOrderInfoPage.js"></script>
    <style>
        #countData {
            font-size: 15px;
            margin: 0 auto;
            /* text-align: center; */
            display: block;
            text-align: center;
            margin-top: 30px;
            font-weight: bold;
        }

    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>报表统计</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>Saas第三方订单统计</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content " style="overflow-x: scroll">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <input id="tenantCode" name="tenantCode" value="${tenant.tenantCode}" type="hidden">
                    <input id="stationName" name="stationName" type="text" class="form-control shortInput"
                           placeholder="站点名称">
                    <select class="form-control shortInput" name="hlhtOperator" id="hlhtOperatorId">
                        <option value="" selected>互联运营商</option>
                        <c:forEach items="${hlhtOperators}" var="hlhtOperator">
                            <option value="${hlhtOperator.hlhtOperatorId}">${hlhtOperator.hlhtOperatorName}</option>
                        </c:forEach>
                    </select>
                    <select class="form-control shortInput" name="equipmentHlhtOperatorId"
                            id="equipmentHlhtOperatorId">
                        <option value="" selected>设备运营商</option>
                        <c:forEach items="${tenantList}" var="tenant">
                            <option value="${tenant.tenantCode}">${tenant.tenantName}</option>
                        </c:forEach>
                    </select>
                    <input id="startTime" name="startTime" type="text" class="form-control shortInput input-distance"
                           placeholder="开始时间">
                    <input id="endTime" name="endTime" type="text" class="form-control shortInput input-distance"
                           placeholder="结束时间">

                    <button class="btn btn-success input-distance" onclick="saasCountOrderInfoPage.reLoad()">查询</button>

<%--                    <div class="pull-left search fr exportNumInput">--%>
<%--                        <input id="count" name="count" type="text" class="form-control"--%>
<%--                               placeholder="导出条数">--%>
<%--                    </div>--%>
                    <div class="pull-left search fr">
                        <button class="btn btn-success input-distance exportBtn" onclick="saasCountOrderInfoPage.exportCountOrderInfo()">导出</button>
                    </div>
                </div>
                </div>

                <%--//普通运营商桩群组件--%>
                <table id="exampleTable" style="word-break:break-all;" data-mobile-responsive="true">
                    <div id="main" style="width: 1000px;height:400px;margin: 0 auto"></div>
                    <span id="countData"></span>
                </table>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

    $(function () {
        $('#equipmentHlhtOperatorId').searchableSelect();
    })

    $(function () {
        $('#hlhtOperatorId').searchableSelect();
    })

    var thisDate = new Date();
    var year = thisDate.getFullYear();
    var month = thisDate.getMonth() + 1;
    var date = thisDate.getDate();
    if (month < 10) {
        month = '0' + month
    }
    if (date < 10) {
        date = '0' + date
    }

    $('#startTime').val(year + '-' + month + '-' + date + ' ' + '00:00:00');

    $('#endTime').val(year + '-' + month + '-' + date + ' ' + '23:59:59');


    // //日期范围限制
    var start = {
        elem: '#startTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤

    saasCountOrderInfoPage.init()


</script>
</body>
</html>
